{% extends 'layout.html' %}
{% load my_tags %}
{% block content %}
    <div>
        <form action="" method="get" class="form-inline">
            {% csrf_token %}
            <div class="col-lg-6" style="float: right;padding: 0">
                <div class="input-group">
                    <div class="input-group-btn">

                        <select name="condition" id="" class="form-control">
                            <option value="姓名">姓名</option>
                            <option value="qq">qq</option>
                            <option value="班级类型">班级类型</option>
                            <option value="状态">状态</option>
                        </select>

                    </div>
                    <input type="text" name="sou" class="form-control"
                           aria-label="Text input with segmented button dropdown">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </div>
        </form>
    </div>
    <form action="" method="post" class="form-inline">
        {% csrf_token %}

        <select name="action" id="" class="form-control">
            {% if request.path_info == url %}
                <option value="multi_apply">公户转私户</option>
            {% else %}
                <option value="multi_pub">私户转公户</option>
            {% endif %}


        </select>
        <button class="btn btn-info">提交</button>


        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>选择</th>
                <th>序号</th>
                <th>姓名</th>
                <th>QQ</th>
                <th>性别</th>
                <th>出生日期</th>
                <th>手机号</th>
                <th>客户来源</th>
                <th>咨询课程</th>
                <th>班级类型</th>
                <th>状态</th>
                <th>报名记录</th>
                <th>跟进记录</th>
                <th>销售</th>
                <th>班级</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {% for customer in all_customer %}
                <tr>
                    <td><input type="checkbox" name="customer_pk" value="{{ customer.id }}"></td>
                    <td>{{ forloop.counter }}</td>
                    <td>{{ customer.name }}</td>
                    <td>{{ customer.qq }}</td>
                    <td>{{ customer.get_sex_display }}</td>
                    <td>{{ customer.birthday }}</td>
                    <td>{{ customer.phone }}</td>
                    <td>{{ customer.get_source_display }}</td>
                    <td>{{ customer.course }}</td>
                    <td>{{ customer.get_class_type_display }}</td>
                    <td>{{ customer.show_status }}</td>
                    <td><a href="{% reverse_url request 'enrollFrom' customer.id %}">
                            <button class="btn btn-success" type="button">添加</button>
                        </a>
                        <a href="{% url 'one_enrollment' customer.id %}">
                            <button class="btn btn-success" type="button">查看</button>
                        </a></td>
                    {% if customer.consultant == None %}
                        <td>None</td>
                    {% else %}
                        <td>
                            <a href="{% url 'one_consultrecord' customer.id %}">
                                <button class="btn btn-success" type="button">查看</button>
                            </a></td>

                    {% endif %}
                    <td>{{ customer.consultant }}</td>
                    <td>{{ customer.show_class }}</td>
                    <td><a href="{% reverse_url request 'customer_edit' customer.id %}">
                        <button type="button" class="btn-primary btn ">编辑</button>
                    </a>
                </tr>
            {% endfor %}

            </tbody>
        </table>
        <div style="margin-left: 40%">
            <ul class="pagination"> {{ page_html }}</ul>
        </div>

    </form>

{% endblock %}
